package com.caipin.netty.server;


import com.caipin.netty.decoder.DataMsgHandler;
import com.caipin.netty.decoder.StickyBagHandler;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.handler.codec.string.StringDecoder;


/**
 * @Author: zhunian0322@163.com
 * @DateTime: 2020-02-21 12:29
 * @Description: TODO
 */
public class NettyServerHandlerInitializer extends ChannelInitializer<Channel> {
    @Override
    protected void initChannel(Channel ch) throws Exception {

        ch.pipeline()
                .addLast(new ServerIdleStateHandler())
                .addLast(new StickyBagHandler())
                .addLast(new StringDecoder())
                .addLast(new DataMsgHandler());

    }
}
